go/types.Checker.error (method)
73 uses
go/types (current package)
assignments.go#L81: check.error(x, code, msg)
builtins.go#L567: check.error(argList[1], SwappedMakeArgs, invalidArg+"length and capacity swapped")
call.go#L865: check.error(e, InvalidDeclCycle, "illegal cycle in method declaration")
check.go#L362: check.error(file.Name, BlankPkgName, "invalid package name _")
const.go#L29: check.error(atPos(opPos), InvalidConstVal, "constant result is not representable")
decl.go#L599: check.error(tdecl, UnsupportedFeature, "generic type alias requires GOEXPERIMENT=aliastypeparams")
decl.go#L620: check.error(tdecl, UnsupportedFeature, "generic type alias requires GODEBUG=gotypesalias=1 or unset")
decl.go#L662: check.error(tdecl.Type, MisplacedTypeParam, "cannot use a type parameter as RHS in type declaration")
decl.go#L709: check.error(f.Type, MisplacedTypeParam, "cannot use a type parameter as constraint")
errors.go#L234: func (check *Checker) error(at positioner, code Code, msg string) {
expr.go#L162: check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint")
expr.go#L166: check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint (use ^ for bitwise complement)")
expr.go#L835: check.error(&y, DivByZero, invalidOp+"division by zero")
expr.go#L845: check.error(&y, DivByZero, invalidOp+"division by zero")
expr.go#L1036: check.error(e, InvalidSyntaxTree, "invalid use of ...")
expr.go#L1093: check.error(e, BadTypeKeyword, "use of .(type) outside type switch")
expr.go#L1162: check.error(e, InvalidSyntaxTree, "no key:value expected")
index.go#L273: check.error(at, InvalidSliceExpr, invalidOp+"3-index slice of string")
index.go#L320: check.error(inNode(e, e.Rbrack), InvalidSyntaxTree, "2nd and 3rd index required in 3-index slice")
index.go#L380: check.error(expr.indices[1], InvalidIndex, invalidOp+"more than one index")
instantiate.go#L204: check.error(atPos(pos), WrongTypeArgCount, msg)
interface.go#L178: check.error(name, BlankIfaceMethod, "methods must have a unique non-blank name")
interface.go#L197: check.error(at, InvalidSyntaxTree, "methods cannot have type parameters")
literals.go#L144: check.error(e, UntypedLit, "missing type in composite literal")
literals.go#L155: check.error(e, InvalidTypeCycle, "invalid recursive type")
literals.go#L172: check.error(e, MixedStructLit, "mixture of field:value and value elements in struct literal")
literals.go#L190: check.error(kv.Key, MissingLitField, msg)
literals.go#L208: check.error(kv, MixedStructLit, "mixture of field:value and value elements in struct literal")
literals.go#L236: check.error(e, InvalidTypeCycle, "invalid recursive type")
literals.go#L264: check.error(e, InvalidTypeCycle, "invalid recursive type")
literals.go#L274: check.error(e, InvalidTypeCycle, "invalid recursive type")
literals.go#L286: check.error(e, MissingLitKey, "missing key in map literal")
range.go#L155: check.error(noNewVarPos, NoNewVar, "no new variables on left side of :=")
resolver.go#L67: check.error(s, code, "missing type or init expr")
resolver.go#L111: check.error(ident, InvalidInitDecl, "cannot declare init - must be func")
resolver.go#L118: check.error(ident, InvalidMainDecl, "cannot declare main - must be func")
resolver.go#L151: check.error(at, BadImportPath, "cannot use FakeImportC and go115UsesCgo together")
resolver.go#L285: check.error(d.spec.Name, ImportCRenamed, `cannot rename import "C"`)
resolver.go#L291: check.error(d.spec, InvalidInitDecl, "cannot import package as init - init must be a func")
resolver.go#L407: check.error(d.decl.Recv, BadRecv, "method has no receiver")
resolver.go#L533: check.error(ix.orig, InvalidSyntaxTree, "parameterized receiver contains nil parameters")
signature.go#L143: check.error(recvPar.List[n-1], InvalidRecv, "method has multiple receivers")
signature.go#L157: check.error(ftyp.TypeParams, InvalidMethodTypeParams, "methods cannot have type parameters")
signature.go#L303: check.error(rparam.Names[n-1], InvalidRecv, "method has multiple receivers")
signature.go#L401: check.error(name, InvalidSyntaxTree, "anonymous parameter")
signature.go#L421: check.error(list, InvalidSyntaxTree, "list contains both named and anonymous parameters")
stmt.go#L49: check.error(atPos(body.Rbrace), MissingReturn, "missing return")
stmt.go#L143: check.error(s, InvalidSyntaxTree, "case/communication clause expected")
stmt.go#L508: check.error(s, InvalidSyntaxTree, "missing lhs in assignment")
stmt.go#L576: check.error(s, MisplacedBreak, "break not in for, switch, or select statement")
stmt.go#L580: check.error(s, MisplacedContinue, "continue not in for statement")
stmt.go#L593: check.error(s, MisplacedFallthrough, msg)
stmt.go#L613: check.error(s.Cond, InvalidCond, "non-boolean condition in if statement")
stmt.go#L624: check.error(s.Else, InvalidSyntaxTree, "invalid else branch in if statement")
stmt.go#L658: check.error(c, InvalidSyntaxTree, "incorrect expression switch case")
stmt.go#L695: check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
stmt.go#L701: check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
stmt.go#L716: check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
stmt.go#L723: check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
stmt.go#L749: check.error(s, InvalidSyntaxTree, "incorrect type switch case")
stmt.go#L819: check.error(clause.Comm, InvalidSelectCase, "select case must be send or receive (possibly with assignment)")
stmt.go#L841: check.error(s.Cond, InvalidCond, "non-boolean condition in for statement")
stmt.go#L861: check.error(s, InvalidSyntaxTree, "invalid statement")
struct.go#L156: check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be unsafe.Pointer")
struct.go#L159: check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer")
struct.go#L165: check.error(embeddedPos, MisplacedTypeParam, "embedded field type cannot be a (pointer to a) type parameter")
struct.go#L169: check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer to an interface")
typexpr.go#L29: check.error(e, InvalidBlank, "cannot use _ as value or type")
typexpr.go#L100: check.error(e, InvalidIota, "cannot use iota outside constant declaration")
typexpr.go#L313: check.error(e.Len, BadDotDotDotSyntax, "invalid use of [...] array (outside a composite literal)")
typexpr.go#L326: check.error(e, InvalidSyntaxTree, "invalid use of ...")
union.go#L121: check.error(tlist[i], InvalidUnion, "cannot use comparable in union")
union.go#L156: check.error(x, MisplacedTypeParam, "term cannot be a type parameter")